package com.szzg10.jsp.chapter10;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

public class MenuItem extends TagSupport {

	private String itemValue;

	@Override
	public int doStartTag() throws JspException {
		return EVAL_BODY_INCLUDE;
	}
	
	@Override
	public int doEndTag() throws JspException {
		Menu parent = (Menu)getParent();
		parent.addMenuItem(itemValue);
		
		return EVAL_PAGE;
	}
	
	//---getter and setter
	public String getItemValue() {
		return itemValue;
	}

	public void setItemValue(String itemValue) {
		this.itemValue = itemValue;
	}
}
